//配置路由相关的信息
//导入
import VueRouter from 'vue-router'
import Vue from 'vue'

const Home = () => import('@/view/home')   //懒加载
const Personal = () => import('@/view/personal')


//1.通过Vue.use(插件),安装插件
Vue.use(VueRouter)

//2.创建VueRouter对象
const routes = [
	{
		path: '',
		// redirect重定向
		redirect:'/home'
	},
	{
		path:'/home',
		component:Home
	},
	{
		path:'/personal',
		component:Personal
	},
]
const router = new VueRouter({
	//配置路由和组件之间的应用关系
	routes,
  // mode:'history'
})

//3.将router 对象传入到Vue实例
//导出
export default router